package com.baizhi.service.impl;

import com.baizhi.dao.ResourceDAO;
import com.baizhi.entity.Resource;
import com.baizhi.service.ResourceService;
import com.baizhi.util.ResourceUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ResourceServiceImpl implements ResourceService {
    @Autowired
    private ResourceDAO resourceDAO;
    @Override
    public List<Resource> selectAll() {
        List<Resource> resources = resourceDAO.selectParentList(null);
        ResourceUtil.getParentResource(resources,resourceDAO);
        return resources;
    }
}
